package com.springmvc.service.impl;

import com.springmvc.dao.IncomeTableMapper;
import com.springmvc.model.IncomeTable;
import com.springmvc.model.IncomeTableExample;
import com.springmvc.service.IncomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IncomeServiceImpl implements IncomeService {
    @Autowired
    IncomeTableMapper incomeTableMapper;
    @Override
    public List<IncomeTable> selectByExample(IncomeTable incomeTable) {
        IncomeTableExample example=new IncomeTableExample();

        IncomeTableExample.Criteria criteria=example.createCriteria();
        example.setOrderByClause("time desc");

        return incomeTableMapper.selectByExample(example);
    }

    @Override
    public List<IncomeTable> queryByPage() {
        return incomeTableMapper.queryByPage();
    }

    @Override
    public void insert(IncomeTable incomeTable)  {
        incomeTableMapper.insert(incomeTable);
    }
}